package com.android.lovely.ui.widget

import android.content.Context
import android.util.AttributeSet
import android.widget.FrameLayout
import androidx.core.view.isVisible
import com.android.lovely.databinding.LayoutCardGuideBinding
import com.android.lovely.databinding.ViewCreatRoleDotBinding
import com.kotlin.extensions.inflater.LayoutInflaterExt.layoutInflater
import com.kotlin.extensions.view.ViewExt.clickable
import com.liupei.shape.widget.ShapeTextView

/**
 *
 * @author why
 * @date 2025/4/5 17:09
 */
class CreateRoleDotWidget(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs) {
    private val mBinding by lazy {
        ViewCreatRoleDotBinding.inflate(layoutInflater, this, false)
    }

    init {
        addView(mBinding.root)
        showUnChecked()
    }

    fun init(position: Int){
        mBinding.ivUncheck.text = position.toString()
    }

    fun showUnChecked() {
        mBinding.ivUncheck.isVisible = true
        mBinding.ivCheck.isVisible = false
        mBinding.ivDone.isVisible = false
    }

    fun showChecked() {
        mBinding.ivUncheck.isVisible = false
        mBinding.ivCheck.isVisible = true
        mBinding.ivDone.isVisible = false
    }

    fun showDone() {
        mBinding.ivUncheck.isVisible = false
        mBinding.ivCheck.isVisible = false
        mBinding.ivDone.isVisible = true
    }
}